



import React, { Component } from 'react'
import {HashRouter as Hash , BrowserRouter as History,Route,Switch ,Redirect} from "react-router-dom"
import Main from './main';


import LazyLoad from "../utils/lazyload"
export  class MainRouter extends Component {
    render() {
        return (
            <Hash 
                basename=""
            >
                <Route component={MainLayout}/>
            </Hash>
        )
    }
}


// 页面的主视图  
export class  MainLayout extends Component{
    render(){
        return (
            <div className="layout">
                <Switch>
                    <Route path="/" exact render={()=><Redirect to="/login" />}  />
                    <Route path="/login" component={LazyLoad(()=>import("./login"))} ></Route>
                    <Route path="/main" component={Main} />
                    {/* <Route render={()=><Redirect to="/404" />}/> */}
                </Switch>
            </div>
        )
    }
}
